package com.micro.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/test")
public class TestController {

    @GetMapping("/health")
    public Map<String, Object> health() {
        Map<String, Object> response = new HashMap<>();
        response.put("service", "hotel-service");
        response.put("message", "酒店服务运行正常");
        response.put("status", "UP");
        response.put("timestamp", System.currentTimeMillis());
        return response;
    }

    @GetMapping("/info")
    public Map<String, Object> info() {
        Map<String, Object> response = new HashMap<>();
        response.put("service", "hotel-service");
        response.put("port", "8084");
        response.put("description", "酒店管理微服务");
        response.put("version", "1.0.0");
        return response;
    }

    @GetMapping("/search-test")
    public Map<String, Object> searchTest(@RequestParam String city) {
        Map<String, Object> response = new HashMap<>();
        response.put("message", "搜索测试接口");
        response.put("city", city);
        response.put("status", "success");
        return response;
    }
}
